package com.itlong.cloud.user.miniprogram;

import com.itlong.cloud.POJO.PO.AppUserInfoPO;
import com.itlong.cloud.POJO.PO.FeedbackInfoPO;
import com.itlong.cloud.POJO.PO.WelinkBindRelationPO;
import com.itlong.cloud.POJO.VO.miniprogram.WelinkUserVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.io.IOException;


/**
 *<desc>
 *     welink业务处理暴露接口
 *</desc>
 *
 * @createDate 2020/03/19.
 */
@FeignClient(name="user-service")
public interface IWelinkServiceClient {

    /**
     * <desc>
     *      用户登录
     * </desc>
     *
     * @param code
     * @return
     * @author Jiaqi.X
     * @createDate 2020/03/19
     */
    @RequestMapping(path = "/welink/user/login",method = RequestMethod.POST)
    WelinkUserVO login(@RequestParam("code") String code) throws IOException;

    /**
     * <desc>
     *      检测手机号是否已绑定welink
     * </desc>
     *
     * @param phoneNum
     * @return
     * @author Jiaqi.X
     * @createDate 2020/03/19
     */
    @RequestMapping(path = "/welink/user/checkBindPhone",method = RequestMethod.POST)
    String checkBindPhone(@RequestParam("phoneNum") String phoneNum);

    /**
     * <desc>
     *      保存绑定关系
     * </desc>
     *
     * @param welinkBindRelationPO
     * @return
     * @author Jiaqi.X
     * @createDate 2020/03/19
     */
    @RequestMapping(path = "/welink/user/save",method = RequestMethod.POST)
    String save(@RequestBody WelinkBindRelationPO welinkBindRelationPO) throws Exception;

    /**
     * <desc>
     *      意见反馈
     * </desc>
     *
     * @param feedbackInfoPO
     * @return
     * @author Jiaqi.X
     * @createDate 2020/03/20
     */
    @RequestMapping(path = "/welink/user/saveFeedBack",method = RequestMethod.POST)
    void saveFeedBack(@RequestBody FeedbackInfoPO feedbackInfoPO) throws Exception;

    /**
     * <desc>
     *      更新用户信息
     * </desc>
     *
     * @param appUserInfoPO
     * @return
     * @author Jiaqi.X
     * @createDate 2020/03/20
     */
    @RequestMapping(path = "/welink/user/updateUserInfo",method = RequestMethod.POST)
    void updateUserInfo(@RequestBody AppUserInfoPO appUserInfoPO) throws Exception;

    /**
     * <desc>
     *      获取用户信息
     * </desc>
     *
     * @param userId
     * @return
     * @author Jiaqi.X
     * @createDate 2020/01/23
     */
    @RequestMapping(path = "/welink/user/getUserInfo",method = RequestMethod.POST)
    WelinkUserVO getUserInfo(@RequestParam ("userId") String userId);
}
